#override("css")
<link href="#springUrl('/static/css/bootstrap.min.css')" rel="stylesheet">
#end

#override("body")
<body class="white-bg">
<form id="baseForm"  class="form-horizontal m-t" autocomplete="off" data-validator-option="{timely:2, theme:'simple_bottom', focusCleanup:true}">
	<div class="wrapper wrapper-content form-item">
		<div class="panel panel-default">
			<div class="row">
				<input type="hidden" id="operFlag" name="operFlag">

				<br />
				<div class="col-xs-12">
					<div class="form-group">
						<label class="col-md-4 control-label">请选择需要生成数据的表:</label>
						<div class="col-md-4">
							<select class="form-control" name="tableName" required="" aria-required="true" aria-invalid="true" >
								#foreach($!table in $!tableList)
								<option value="$!table.tableName">$!table.tableName:$!table.comments</option>
								#end
							</select>
						</div>
						<label class="col-md-4 control-label">&nbsp;&nbsp;</label>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>
</body>
#end

#override("js")
<script type="text/javascript">
	// 调用方法实现保存
	function save() {
		var result = "";
		var tableName = $("select[name='tableName']").val();

		$.ajax({
			type: "POST",
			url: "#springUrl('/gen/genTable/doAdd')",
			data: $("#baseForm").serialize(),
			async : false,
			success: function (data) {
				if (data.success) {
					result = tableName;
				} else {
					parent.layer.alert(data.message, {icon: 2}, function (index) {
						parent.layer.close(index);
					});
				}
			}
		});
		return result;
	}
</script>
#end
#extends("/common/base.html")